DEBUG_VERSION = TRUE

CODE_ROOT = T:

CC=gcc

SOURCE_PATH = $(CODE_ROOT)/code/source
INCLUDE_PATH=-I$(CODE_ROOT)/code/include
BUILD_PATH = $(CODE_ROOT)/build
OBJS_PATH = $(BUILD_PATH)/objects

EXE_FILENAME = run.exe

MAIN_SRCS = $(wildcard $(SOURCE_PATH)/*.c)
MAIN_OBJS = $(addprefix $(OBJS_PATH)/,$(subst .c,.o,$(notdir $(MAIN_SRCS))))
ALL_OBJS += $(MAIN_OBJS)

$(OBJS_PATH)/%.o:$(SOURCE_PATH)/%.c
	@echo Making $(notdir $*.c) ...
	@$(CC) $(CFLAGS) $(INCLUDE_PATH) -c $(SOURCE_PATH)/$*.c -o $@
	@echo $(notdir $@) 
	@echo Done!

$(BUILD_PATH)/$(EXE_FILENAME):$(ALL_OBJS)
	@echo =========================================================================
	@echo =                         Begin to Link...                              =
	@echo =========================================================================
	@echo Linking $(notdir $^) ...
	@$(CC) -o $@ $^
	@echo make finish!

clean:
	@del $(ALL_OBJS) 
#$(BUILD_PATH)/$(EXE_FILENAME)
	@echo del $(notdir $(ALL_OBJS))